/*
 * @Author: long
 * @Date: 2021-04-23 11:47:43
 * @LastEditTime: 2021-09-26 19:32:31
 * @LastEditors: Please set LastEditors
 * @Description: 面包屑导航处理
 * @FilePath: \ant-design-vue-jeecge:\hjimi\人脸辨识云\html\gitlab\pc\faceCloudWebsite\src\utils\i18n.js
 */
import store from '@/store'
// import {mapState,mapMutations} from 'vuex'
export function generateTitle(title, lastTit) {
  let isLastTit = lastTit ?? false
  const hasKey = this.$te('route.' + title)

  if (hasKey) {
    // $t :this method from vue-i18n, inject in @/lang/index.js
    const translatedTitle = this.$t('route.' + title)

    return translatedTitle
  }
   if(isLastTit) {
     store.commit('nav/SET_breadcrumbLastTit', title)
   }
  return title
  }